//
//  GSYResources.h
//  GoTraveling
//
//  Created by dllo on 15/12/23.
//  Copyright © 2015年 开发华佗. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, HXResult) {
    HXData,
    HXJSON,
    HXXML,
};
typedef NS_ENUM(NSUInteger, HXRequestStyle) {
    HXRequestJSON,
    HXRequestString
};




typedef void(^myblock)(id result);
typedef void(^errorBlock)();


@interface GSYResources : NSObject

+ (void)getDataWithName:(NSString *)str block:(myblock)block error:(errorBlock)errors;

/**
 *  Post请求
 *
 *  @param url          网络请求地址
 *  @param body         请求体
 *  @param result       返回值的数据类型
 *  @param requestStyle 网络请求Body的类型
 *  @param headerFile   网络请求头
 *  @param success      成功回调
 *  @param failure      失败回调
 */
+ (void)postUrl:(NSString *)url
           body:(id)body
         result:(HXResult)result
   requestStyle:(HXRequestStyle)requestStyle
     headerFile:(NSDictionary *)headerFile
        success:(void (^)(id result))success
        failure:(void (^)(NSError *error))failure;

@end
